package com.communication;

/**
 * @author Zhang Guangyong
 * @desacription 存钱线程
 * @date 2019年08月19日 9:39
 */
public class DepositThread extends Thread{

    private Account account;

    private double depositAmount;

    public DepositThread(String name, Account account, double depositAmount) {
        super(name);
        this.account = account;
        this.depositAmount = depositAmount;
    }

    public void run() {
        for (int i = 0; i < 100; i++) {
            account.deposit(depositAmount);
        }
    }
}
